<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class ModuleRequest extends FormRequest
{
    public function rules()
    {
        return [
            'zh_name' => 'required|string',
            'name' => 'required|string|unique:modules',
        ];
    }
    public function messages()
    {
        return [
            'zh_name.required'=>  '中文名称必填项',
            'name.required'  =>  '权限标识为必填项',
            'name.unique'  =>  '权限标识已经存在',
        ];

    }
    public function authorize()
    {
        return true;
    }
}
